package tr.edu.yildiz.ce.dap.appagent;

import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;

import tr.edu.yildiz.ce.dap.appagent.manager.AgentProcessManager;

public class AppAgentActivator implements BundleActivator{
	
	AgentProcessManager pManager; 
	
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext context) throws Exception {
		pManager = new AgentProcessManager(context);
		new Thread(pManager).start();
		System.out.println("App Agent started successfully.");
	}
	
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext context) throws Exception {
		pManager.stop();
		System.out.println("App Agent stopped");
	}

}
